import { EntitySchema } from '@mikro-orm/core';

export class ImsYzdKpGoodComment {
  id!: number;
  orderId!: number;
  goodId!: number;
  imglist?: unknown;
  content?: unknown;
  type!: number;
  anonymous!: boolean;
  uniacid!: number;
  userTime!: string;
  webTime?: string;
  state: boolean = true;
  webContent?: unknown;
  userId!: number;
}

export const ImsYzdKpGoodCommentSchema = new EntitySchema({
  class: ImsYzdKpGoodComment,
  properties: {
    id: { primary: true, type: 'number' },
    orderId: { type: 'number', index: 'order_id' },
    goodId: { type: 'number', index: 'good_id' },
    imglist: { type: 'unknown', columnType: 'longtext', nullable: true },
    content: { type: 'unknown', columnType: 'longtext', nullable: true },
    type: { type: 'number', index: 'type' },
    anonymous: { type: 'boolean' },
    uniacid: { type: 'number' },
    userTime: { type: 'string', length: 255 },
    webTime: { type: 'string', length: 255, nullable: true },
    state: { type: 'boolean', default: true, index: 'state' },
    webContent: { type: 'unknown', columnType: 'longtext', nullable: true },
    userId: { type: 'number', index: 'user_id' },
  },
});
